#pragma once
#include "base/core/singleton.h"
#include "ProtoBuffer/ServerInternalProtocol.pb.h"

using namespace ProtoBuf;
class ErrCollectMgr : public ManualSingleton<ErrCollectMgr>
{
	friend class ManualSingleton<ErrCollectMgr>;
	typedef ::google::protobuf::RepeatedPtrField< ::std::string> ERR_LOG_LIST;

protected:
	ERR_LOG_LIST m_errLst;
	std::string m_errPre;

public:
	bool Init(std::string  preString);
	bool PackErrLogs(ErrLogCollect &errCollect);
	static bool CollectErr(char* buffer, uint32_t length);

	ErrCollectMgr();
	virtual ~ErrCollectMgr();
};

#define g_MakeErrCollectMgr() (ErrCollectMgr::Instance())
#define g_GetErrCollectMgr()  (ErrCollectMgr::GetInstance())
#define g_DelErrCollectMgr()  (ErrCollectMgr::Destroy())